package com.freeman.cement.myenum;

import lombok.Getter;

@Getter
public enum ProcessingFlow {
    UNTREATED("未处理", 1),
    RECVALARM("已接警", 2),
    NOTIFYHANDLER("通知处理人", 3),
    PROCESSING("处理中", 4),
    TOBEACCEPTED("待验收", 5),
    COMPLETED("处理完成", 6),
    CLOSED("已关闭", 7),
    ERROR("处理异常", 8);

    // 成员变量
    private String name;
    private int index;

    // 构造方法
    private ProcessingFlow(String name, int index) {
        this.name = name;
        this.index = index;
    }

    // 普通方法
    public static String getName(int index) {
        for (ProcessingFlow c : ProcessingFlow.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }

}



